package com.qk.management.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.qk.common.PageResult;
import com.qk.domain.operatelog.OperateLogDO;
import com.qk.dto.operatelog.OperateLogDTO;
import com.qk.entity.OperateLog;
import com.qk.management.mapper.OperateLogMapper;
import com.qk.management.service.OperateLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
 * @author 李智勇
 * @data 2025/10/17 19:44
 */

@Slf4j
@Service
@SuppressWarnings("all")
public class OperateLogServiceImpl extends ServiceImpl<OperateLogMapper, OperateLog> implements OperateLogService {

    @Override
    public PageResult<OperateLogDO> operateLogList(OperateLogDTO dto) {
        PageHelper.startPage(dto.getPage(), dto.getPageSize());
        Page<OperateLogDO> list = baseMapper.selectByPage(dto);
        return PageResult.<OperateLogDO>builder()
                .total(list.getTotal())
                .rows(list.getResult())
                .build();

    }
}
